//
//  trajectory_generated.cpp
//  map-matching
//
//  Created by Lv Xin on 16/4/14.
//  Copyright © 2016年 Lv Xin. All rights reserved.
//

#include "trajectory_generated.h"
#include "map.h"
#include <iostream>
#include <fstream>

GenerateTrajectory::GenerateTrajectory(){
    point.clear();
}

GenerateTrajectory::~GenerateTrajectory(){
    
}

void GenerateTrajectory::fileAddPos(std::string file){
    std::ifstream fin;
    fin.open(file.c_str());
    //freopen(file.c_str(), "r", stdin);
    double lat, lng;
    while(fin >> lat >> lng){
        PosWithRank m;
        DoublePos temp;
        temp.lat = lat, temp.lng = lng;
        m.rank = 0;//仅仅用于直接测试，此处没意义
        m.pos = temp;
        point.push_back(m);
    }
    fin.close();
//    scanf("%lf %lf", &lat, &lng);
//    fdopen(origin_stdin, "r");
}